﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Data;
using Util;
namespace Presentation
{
    public partial class AreaCadastro : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void TxtArea_TextChanged(object sender, EventArgs e)
        {

        }

        protected void BtnCadastrar_Click(object sender, EventArgs e)
        {
            TBArea obj = new TBArea();
            obj.Descricao= TxtArea.Text;

            using (DBUCNEntities banco = new DBUCNEntities())
            {
                banco.AddToTBAreas(obj);
                banco.SaveChanges();

            }

            UtilCommom.exibirMensagem(this, "Área cadastrada com sucesso");
            Response.Redirect("Default.aspx");
        }
    }
}